package qianfeng.com.jswebproject.bean;

import android.content.Context;
import android.webkit.JavascriptInterface;
import android.widget.Toast;

/**
 */
public class JSActionObject {
    private Context mContext;
    public JSActionObject (Context context){
        mContext = context;
    }
    // 如果这个方法是用来和JavaScript 交互那么它必须加上这个注解
    @JavascriptInterface
    public void showToast(String msg){
        Toast.makeText(mContext,msg,Toast.LENGTH_SHORT).show();
    }

    @JavascriptInterface
    public void sub(int a,int b){
        Toast.makeText(mContext,(a-b)+"",Toast.LENGTH_SHORT).show();
    }
}
